package com.unis.iptv.common.utils;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class SaveHtml {
	private static Log iptvCourse = LogFactory.getLog("iptvCourse");
	
	public static void saveHtml(String htmlString) throws IOException {
		RandomAccessFile doc;
		try {
			doc = new RandomAccessFile(
					"/Users/yangfeiyu/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testStb/aa.html",
					"rw");
			doc.seek(doc.length());
			doc.write(htmlString.getBytes());
			iptvCourse.info("文件已经写入!!");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			saveHtml("www");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
